package com.ruoyi.visitor.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.visitor.mapper.VisitorWxUserMapper;
import com.ruoyi.visitor.domain.VisitorWxUser;
import com.ruoyi.visitor.service.IVisitorWxUserService;
import com.ruoyi.common.core.text.Convert;

/**
 * 微信用户信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-12
 */
@Service
public class VisitorWxUserServiceImpl implements IVisitorWxUserService 
{
    @Autowired
    private VisitorWxUserMapper visitorWxUserMapper;

    /**
     * 查询微信用户信息
     * 
     * @param id 微信用户信息主键
     * @return 微信用户信息
     */
    @Override
    public VisitorWxUser selectVisitorWxUserById(Long id)
    {
        return visitorWxUserMapper.selectVisitorWxUserById(id);
    }

    /**
     * 查询微信用户信息列表
     * 
     * @param visitorWxUser 微信用户信息
     * @return 微信用户信息
     */
    @Override
    public List<VisitorWxUser> selectVisitorWxUserList(VisitorWxUser visitorWxUser)
    {
        return visitorWxUserMapper.selectVisitorWxUserList(visitorWxUser);
    }

    /**
     * 新增微信用户信息
     * 
     * @param visitorWxUser 微信用户信息
     * @return 结果
     */
    @Override
    public int insertVisitorWxUser(VisitorWxUser visitorWxUser)
    {
        visitorWxUser.setCreateTime(DateUtils.getNowDate());
        return visitorWxUserMapper.insertVisitorWxUser(visitorWxUser);
    }

    /**
     * 修改微信用户信息
     * 
     * @param visitorWxUser 微信用户信息
     * @return 结果
     */
    @Override
    public int updateVisitorWxUser(VisitorWxUser visitorWxUser)
    {
        return visitorWxUserMapper.updateVisitorWxUser(visitorWxUser);
    }

    /**
     * 批量删除微信用户信息
     * 
     * @param ids 需要删除的微信用户信息主键
     * @return 结果
     */
    @Override
    public int deleteVisitorWxUserByIds(String ids)
    {
        return visitorWxUserMapper.deleteVisitorWxUserByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除微信用户信息信息
     * 
     * @param id 微信用户信息主键
     * @return 结果
     */
    @Override
    public int deleteVisitorWxUserById(Long id)
    {
        return visitorWxUserMapper.deleteVisitorWxUserById(id);
    }
}
